package org.tq.test.validate;

import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

public class ValidBeanValidator implements Validator {

	public boolean supports(Class<?> clazz) {
		return ValidBean.class.equals(clazz);
	}

	public void validate(Object target, Errors errors) {
		errors.rejectValue("name", "field_error", "姓名不能为空");
	}

}
